ëMore Macintosh ToolboxContentsFigures, Tables, and ListingsAbout This BookFormat of a Typical ChapterConventions Used in This Book
Special FontsTypes of Notes
Empty StringsAssembly-Language InformationThe Development EnvironmentResource ManagerIntroduction to Resources#The Data Fork and the Resource Fork4Figure 1-1 The data fork and resource fork of a fileHFigure 1-2 An application’s and a document’s data fork and resource forkResource Types and Resource IDsThe Resource MapFigure 1-3 Resource attributesSearch Path for Resources9Figure 1-4 A typical search order for a specific resource)Table 1-1 Typical locations of resources About the Resource ManagerUsing the Resource ManagerCreating a Resource<Figure 1-5 The ResEdit window for the SurfWriter application2Figure 1-6 The menus of the SurfWriter application&Listing 1-1 A menu in Rez input formatGetting a Resource)Figure 1-7 Getting a handle to a resourceNFigure 1-8 A handle to a purgeable resource after the resource has been purged9Listing 1-2 Safely changing a resource that is purgeable !Releasing and Detaching Resources!Listing 1-3 Releasing a resource Figure 1-9 Detaching a resource!Listing 1-4 Detaching a resource Opening a Resource Fork&Opening an Application’s Resource ForkSListing 1-5 Getting the file reference number for your application’s resource fork $Creating and Opening a Resource Fork,Listing 1-6 Creating an empty resource fork 1Listing 1-7 Creating and opening a resource fork $Specifying the Current Resource File:Listing 1-8 Saving and restoring the current resource file"Reading and Manipulating Resources3Listing 1-9 Getting a resource from a document file5Listing 1-10 Counting and indexing through resources Writing Resources1Listing 1-11 Saving a resource to a resource forkWorking With Partial Resources-Listing 1-12 Using partial resource routines Resource Manager Reference0Data Structure, Resource Types, and Resource IDsThe Resource Type,Table 1-2 Standard resource types(continued)=Table 1-3 Resource types reserved for use by system software Resource IDsResource IDs of Owned Resources,Figure 1-10 Resource ID of an owned resourceResource NamesResource Manager Routines!Initializing the Resource Manager
InitResourcesRsrcZoneInitChecking for ErrorsResErrorCreating an Empty Resource ForkFSpCreateResFileHCreateResFile
OpenRFPermOpenResFile-Getting and Setting the Current Resource File
CurResFile
UseResFileHomeResFileReading Resources Into MemoryGetResourceGet1ResourceGetNamedResourceGet1NamedResourceRGetResource
SetResLoadLoadResource(Getting and Setting Resource Information
GetResInfo
SetResInfoGetResAttrsSetResAttrsModifying ResourcesChangedResourceAddResourceWriting to Resource Forks
UpdateResFile
WriteResourceSetResPurgeGetting a Unique Resource IDUniqueID Unique1ID#Counting and Listing Resource TypesCountResourcesCount1ResourcesGetIndResourceGet1IndResource
CountTypesCount1Types
GetIndTypeGet1IndTypeGetting Resource SizesGetResourceSizeOnDiskGetMaxResourceSizeDisposing of ResourcesReleaseResourceDetachResourceRemoveResourceClosing Resource ForksCloseResFile%Reading and Writing Partial ResourcesReadPartialResourceWritePartialResourceSetResourceSize,Getting and Setting Resource Fork AttributesGetResFileAttrsSetResFileAttrs,Accessing Resource Entries in a Resource MapRsrcMapEntryResource File Format%Figure 1-11 Format of a resource fork;Figure 1-12 Format of a resource header in a resource fork :Figure 1-13 Format of resource data for a single resource :Figure 1-14 Format of the resource map in a resource fork 6Figure 1-15 Format of an item in a resource type list IFigure 1-16 Format of an entry in the reference list for a resource type 6Figure 1-17 Format of an item in a resource name list ^Figure 1-18 Offsets in a resource fork and an entry for a single resource in a reference list Resources in the System FileUser Information ResourcesPackagesFunction Key ResourcesStandard Icons)Table 1-4 Document and application icons Table 1-5 Folder icons Table 1-6 System Folder icons Table 1-7 Desktop icons0Table 1-8 Standard File Package icons(continued)
ROM ResourcesInserting the ROM Resource MapOverriding ROM ResourcesBFigure 1-19 Structure of a compiled ROM override ('ROv#') resourceSummary of the Resource Manager
Scrap Manager"
Introduction to the Scrap ManagerLFigure 2-1 Copying and pasting data between two applications using the scrapJTable 2-1 Actions your application perfoms in response to editing commands5Figure 2-2 Writing both standard formats to the scrap Figure 2-3 Using a private scrap
The ClipboardIntelligent Cut and Paste$Figure 2-4 Intelligent cut and paste(Figure 2-5 Non-intelligent cut and paste
About the Scrap ManagerLocation of the Scrap*Figure 2-6 Location of the scrap in memoryUsing the Scrap Manager#Getting Information About the ScrapPutting Data in the ScrapHandling the Cut Command%Listing 2-1 Writing data to the scrap+Listing 2-2 Writing data to a private scrapHandling the Copy CommandHandling Suspend EventsEListing 2-3 Copying data from the scrap in response to suspend eventsGetting Data From the ScrapHandling the Paste Command6Listing 2-4 Handling the Paste command using the scrap<Listing 2-5 Handling the Paste command using a private scrapHandling Resume Events"Listing 2-6 Handling resume events5Converting Data Between a Private Scrap and the ScrapAListing 2-7 Converting data between the scrap and a private scrap8Converting Data Between the TextEdit Scrap and the Scrap4Listing 2-8 Using TextEdit to handle the Cut command6Listing 2-9 Using TextEdit to handle the Paste command+Handling Editing Operations in Dialog BoxesScrap Manager ReferenceData StructuresThe Scrap Information RecordThe Scrap Format TypesRoutines#Getting Information About the Scrap InfoScrap Writing Information to the Scrap ZeroScrapPutScrap"Reading Information From the ScrapGetScrapCTransferring Data Between the Scrap in Memory and the Scrap on DiskUnloadScrap LoadScrap
Summary of the Scrap ManagerHelp ManagerAbout the Help Manager'Figure 3-1 The Help menu for the Finder&How the Help Manager Displays BalloonsMFigure 3-2 A help balloon drawn with the standard balloon definition function7Figure 3-3 The tip and hot rectangle for a help balloon?Figure 3-4 Standard balloon positions and their variation codes0Figure 3-5 Alternate positions of a help balloon3Default Help Balloons for Menus, Windows, and Icons5Figure 3-6 Default help balloons for the window frame=Figure 3-7 Default help balloons for the Apple and Help menusCFigure 3-8 Default help balloons for application and document iconsAbout BalloonWriter
Using the Help Manager,Providing Text or Pictures for Help BalloonsDefining Help MessagesUsing Clear, Concise PhrasesUsing Active ConstructionsUsing Parallel StructureOffering HintsUsing Consistent Terminology"Defining the Help Balloon Position'Specifying the Format for Help Messages$Specifying Options in Help Resources!Providing Help Balloons for Menus@Figure 3-9 Help balloons for different states of the Cut command3Listing 3-1 Rez input for a partial 'hmnu' resource5Specifying Header Information for the 'hmnu' Resource8Specifying Help for Menu Items Missing From the ResourceKListing 3-2 Rez input for the missing-items component of an 'hmnu' resourceGSpecifying Help for Menu Titles and for Items Dimmed by System Software4Figure 3-10 A help balloon for an enabled menu title2Figure 3-11 A help balloon for a dimmed menu titleHFigure 3-12 A help balloon for a menu title dimmed by the Dialog ManagerFFigure 3-13 A help balloon for menu items dimmed by the Dialog ManagerSpecifying Help for Menu Items*Figure 3-14 A help balloon for a menu item1Figure 3-15 A help balloon for a dimmed menu itemCListing 3-3 Rez input for corresponding 'hmnu' and 'STR#' resources(Specifying Help for a Changing Menu Item]Listing 3-4 Rez input for an 'hmnu' resource that uses HMCompareItem for a changing menu item2Figure 3-16 Help balloons for a changing menu item!Specifying Resources by Item NameGListing 3-5 Rez input for specifying help messages with named resources>Providing Help Balloons for Menus You Disable for Dialog BoxesâListing 3-6 Specifying an alternate 'hmnu' resource for a menu that your application disables when it displays movable modal dialog boxesUListing 3-7 Reassigning 'hmnu' resources before displaying a movable modal dialog boxAProviding Help Balloons for Items in Dialog Boxes and Alert Boxes5Specifying Header Information for the 'hdlg' Resource#Specifying Missing-Item Information3Specifying Help for Items in an Alert or Dialog BoxFListing 3-8 Rez input for an item list resource and an 'hdlg' resource0Figure 3-17 A help balloon in a modal dialog box+Adding a Help Item to an Item List Resource1Using a Help Item Versus Using an 'hwin' Resource*Providing Help Balloons for Window Content&Figure 3-18 Static and dynamic windows*Providing Help Balloons for Static Windows5Specifying Header Information for the 'hrct' Resource)Specifying Help for Rectangles in Windows.Associating Help Resources With Static Windows5Specifying Header Information for the 'hwin' Resource<Specifying 'hdlg' or 'hrct' Resources in the 'hwin' Resource.Figure 3-19 A tool palette with a help balloonCListing 3-9 Rez input for corresponding 'hwin' and 'hrct' resources8Figure 3-20 A help balloon for a dialog box with a titleJListing 3-10 Rez input for specifying help for titled and untitled windows+Providing Help Balloons for Dynamic WindowsJListing 3-11 Using a string resource as the help message for HMShowBalloonKListing 3-12 Using a picture resource as the help message for HMShowBalloonWListing 3-13 Using a handle to a picture resource as the help message for HMShowBalloonOListing 3-14 Using a string list resource as the help message for HMShowBalloonNListing 3-15 Using styled text resources as the help message for HMShowBalloon9Listing 3-16 Using HMShowBalloon to display help balloons/Overriding Help Balloons for Non-Document Icons5Specifying Header Information for the 'hfdr' ResourceSpecifying Help for an IconDFigure 3-21 Default and custom help balloons for an application iconNListing 3-17 Rez input for creating an 'hfdr' resource for an application icon&Overriding Other Default Help Balloons5Specifying Header Information for the 'hovr' ResourceOverriding Default Help-Listing 3-18 Rez input for an 'hovr' resource"Adding Menu Items to the Help Menu4Figure 3-22 The Help menu with an appended menu itemNListing 3-19 Rez input for specifying help balloons for items in the Help menu>Listing 3-20 Responding to the user’s choice in a menu command,Writing Your Own Balloon Definition FunctionHelp Manager ReferenceData StructuresThe Help Message Record#The Help Manager String List RecordHelp Manager Routines Determining Balloon Help Status
HMGetBalloonsHMIsBalloon%Displaying and Removing Help Balloons
HMShowBalloonHMShowMenuBalloonHMRemoveBalloon.Enabling and Disabling Balloon Help Assistance
HMSetBalloonsAdding Items to the Help MenuHMGetHelpMenuHandle*Getting and Setting the Font Name and Size HMGetFont
HMGetFontSize HMSetFont
HMSetFontSize2Setting and Getting Information for Help ResourcesHMSetMenuResIDHMGetMenuResIDHMScanTemplateItemsHMSetDialogResIDHMGetDialogResID&Determining the Size of a Help Balloon
HMBalloonRect
HMBalloonPictHMGetBalloonWindow%Getting the Message of a Help BalloonHMExtractHelpMsg0Listing 3-21 Using the HMExtractHelpMsg functionHMGetIndHelpMsgApplication-Defined RoutinesMyBalloonDefMyTip!Listing 3-22 Using a tip function ResourcesThe Menu Help Resource?Figure 3-23 Structure of a compiled menu help ('hmnu') resourceVFigure 3-24 Structure of an 'hmnu' component compiled with the HMStringItem identifierYFigure 3-25 Structure of an 'hmnu' component compiled with the HMStringResItem identifierrFigure 3-26 Structure of an 'hmnu' component compiled with the HMPictItem, HMTEResItem, or HMSTRResItem identifierTFigure 3-27 Structure of an 'hmnu' component compiled with the HMSkipItem identifierYFigure 3-28 Structure of a menu-item component compiled with the HMCompareItem identifier_Figure 3-29 Structure of a menu-item component compiled with the HMNamedResourceItem identifierThe Dialog-Item Help ResourceFFigure 3-30 Structure of a compiled dialog-item help ('hdlg') resourceVFigure 3-31 Structure of an 'hdlg' component compiled with the HMStringItem identifierYFigure 3-32 Structure of an 'hdlg' component compiled with the HMStringResItem identifierrFigure 3-33 Structure of an 'hdlg' component compiled with the HMPictItem, HMTEResItem, or HMSTRResItem identifierTFigure 3-34 Structure of an 'hdlg' component compiled with the HMSkipItem identifierThe Rectangle Help ResourceDFigure 3-35 Structure of a compiled rectangle help ('hrct') resourceVFigure 3-36 Structure of an 'hrct' component compiled with the HMStringItem identifierYFigure 3-37 Structure of an 'hrct' component compiled with the HMStringResItem identifierrFigure 3-38 Structure of an 'hrct' component compiled with the HMPictItem, HMTEResItem, or HMSTRResItem identifierTFigure 3-39 Structure of an 'hrct' component compiled with the HMSkipItem identifierThe Window Help ResourceAFigure 3-40 Structure of a compiled window help ('hwin') resourceThe Finder Icon Help ResourceFFigure 3-41 Structure of a compiled Finder icon help ('hfdr') resourceVFigure 3-42 Structure of an 'hfdr' component compiled with the HMStringItem identifierYFigure 3-43 Structure of an 'hfdr' component compiled with the HMStringResItem identifierrFigure 3-44 Structure of an 'hfdr' component compiled with the HMPictItem, HMTEResItem, or HMSTRResItem identifierTFigure 3-45 Structure of an 'hfdr' component compiled with the HMSkipItem identifier"The Default Help Override ResourceKFigure 3-46 Structure of a compiled default help override ('hovr') resourceVFigure 3-47 Structure of an 'hovr' component compiled with the HMStringItem identifierYFigure 3-48 Structure of an 'hovr' component compiled with the HMStringResItem identifierrFigure 3-49 Structure of an 'hovr' component compiled with the HMPictItem, HMTEResItem, or HMSTRResItem identifierTFigure 3-50 Structure of an 'hovr' component compiled with the HMSkipItem identifier
Summary of the Help Manager List Manager
Introduction to ListsAppearance of Lists<Figure 4-1 A one-column, text-only list without a scroll barBFigure 4-2 A one-column, text-only list with a vertical scroll bar4Figure 4-3 A list whose scroll bar has been disabledFigure 4-4 A deactivated listDFigure 4-5 A list containing multiple columns and graphical elementsPFigure 4-6 A list of items whose cells display more than one type of informationSelection of List Items'Figure 4-7 A list with an item selected2Figure 4-8 Selection of a range of items in a list2Figure 4-9 Effect of dragging after Shift-clicking6Figure 4-10 Selection of discontiguous items in a listPFigure 4-11 Effect of Shift-clicking in a list that contains discontiguous items;Figure 4-12 Notifying the user of nonstandard list behaviorKeyboard Navigation of Lists'Movement of a Selection With Arrow Keys:Figure 4-13 Response to pressing the Command–Up Arrow keys(Extension of a Selection With Arrow KeysñFigure 4-14 Response to user making a discontiguous selection, then pressing Shift–Right Arrow followed by Shift–Left Arrow using the extend algorithmDFigure 4-15 Response to Shift–Right Arrow using the anchor algorithm"Type Selection in a Text-Only ListMultiple Lists in a Window@Figure 4-16 An outlined list in a window with more than one list
About the List Manager Figure 4-17 Coordinates of cells
Using the List ManagerCreating a List6Listing 4-1 Creating a list with a vertical scroll bar-Listing 4-2 Installing a list in a dialog box*Listing 4-3 Drawing a border around a list!Adding Rows and Columns to a ListKListing 4-4 Adding items from a string list to a one-column, text-only list%Responding to Events Affecting a List6Listing 4-5 Responding to a mouse-down event in a list3Listing 4-6 Responding to an update event in a listWorking With List Selections5Listing 4-7 Finding the first selected cell in a list4Listing 4-8 Finding the last selected cell in a list8Listing 4-9 Selecting a cell and deselecting other cells;Listing 4-10 Scrolling so that a particular cell is visibleCustomizing Cell HighlightingFigure 4-18 Selection flagsManipulating List Cells#Listing 4-11 Clearing all cell data1Listing 4-12 Getting a copy of the data of a cell-Listing 4-13 Directly accessing a cell’s dataCListing 4-14 Adding an item to a one-column, alphabetical text list&Searching a List for a Particular ItemListing 4-15 A match function `Listing 4-16 Searching a list for a cell containing certain text or the next cell alphabetically'Supporting Keyboard Navigation of Lists'Supporting Type Selection of List Items:Listing 4-17 Resetting variables related to type selection>Listing 4-18 Selecting an item in response to a key-down event(Supporting Arrow-Key Navigation of ListsUListing 4-19 Determining the location of a new cell in response to an arrow-key eventCListing 4-20 Moving the selection in response to an arrow-key eventFListing 4-21 Extending the selection in response to an arrow-key event*Listing 4-22 Processing an arrow-key eventCSupporting the Anchor Algorithm for Extending Lists With Arrow KeysOutlining the Current List-Listing 4-23 Drawing an outline around a list&Listing 4-24 Adding a list to the ring:Listing 4-25 Updating the outline of all lists in a window<Listing 4-26 Moving the outline to the next list in a window@Listing 4-27 Moving the outline to the previous list in a window*Writing Your Own List Definition ProcedureCFigure 4-19 The Chooser’s use of a custom list definition procedure?Listing 4-28 Processing messages to a list definition procedure(Responding to the Initialization Message4Listing 4-29 Using the default initialization methodResponding to the Draw Message/Listing 4-30 Responding to the lDrawMsg message&Responding to the Highlighting Message1Listing 4-31 Responding to the lHiliteMsg messageResponding to the Close Message0Listing 4-32 Responding to the lCloseMsg message,Using the Pictures List Definition Procedure,Listing 4-33 Setting the cell size of a list.Listing 4-34 Adding an icon to a list of icons
List Manager ReferenceData StructuresThe Cell RecordThe Data HandleThe List RecordList Manager RoutinesCreating and Disposing of ListsLNewLDispose7Adding and Deleting Columns and Rows To and From a List
LAddColumnLAddRow
LDelColumnLDelRow%Determining or Changing the Selection
LGetSelect
LSetSelect$Accessing and Manipulating Cell DataLSetCell
LAddToCellLClrCellLGetCellDataLocationLGetCell$Responding to Events Affecting ListsLClick LActivateLUpdateModifying a List’s AppearanceLSetDrawingModeLDrawLAutoScrollLScroll&Searching a List for a Particular ItemLSearch$Changing the Size of Cells and ListsLSize LCellSizeGetting Information About Cells LNextCellLRect
Summary of the List ManagerIcon Utilities"Introduction to the Icon Utilities&Figure 5-1 The ResEdit view of an iconFigure 5-2 An icon family About the Icon UtilitiesUsing the Icon UtilitiesDrawing Icons in an Icon Family(Drawing an Icon Directly From a Resource[Listing 5-1 Drawing the icon from an icon family that is best suited to the user’s display 2Getting an Icon Suite and Drawing One of Its IconsZListing 5-2 Drawing the icon from an icon suite that is best suited to the display device *Drawing Specific Icons From an Icon FamilyFListing 5-3 Drawing a specific icon from an icon family or icon suite Manipulating Icons-Listing 5-4 Manipulating icon data in memory 1Drawing Icons That Are Not Part of an Icon Family3Listing 5-5 Drawing an icon of resource type 'ICON'\Listing 5-6 Drawing an icon of resource type 'ICON' with a specific alignment and transform 3Listing 5-7 Drawing an icon of resource type 'cicn'[Listing 5-8 Drawing an icon of resource type 'cicn' with a specific alignment and transform\Listing 5-9 Drawing an icon of resource type 'SICN' with a specific alignment and transform Icon Utilities ReferenceData StructureThe Color Icon RecordIcon Utilities RoutinesDrawing Icons From Resources
PlotIconIDPlotIconMethodPlotIconPlotIconHandle PlotCIconPlotCIconHandlePlotSICNHandle@Getting Icons From Resources That Don’t Belong to an Icon FamilyGetIconGetCIconDisposing of IconsDisposeCIconCreating an Icon SuiteGetIconSuiteNewIconSuiteAddIconToSuite Getting Icons From an Icon SuiteGetIconFromSuite Drawing Icons From an Icon Suite
PlotIconSuite/Performing Operations on Icons in an Icon Suite
ForEachIconDo/Getting and Setting the Label for an Icon Suite
GetSuiteLabel
SetSuiteLabelGetting Label InformationGetLabelDisposing of Icon SuitesDisposeIconSuite#Converting an Icon Mask to a RegionIconSuiteToRgnIconIDToRgnIconMethodToRgn:Determining Whether a Point or Rectangle Is Within an Icon
PtInIconSuite
PtInIconIDPtInIconMethodRectInIconSuiteRectInIconIDRectInIconMethodWorking With Icon Caches
Summary of the Icon UtilitiesComponent ManagerIntroduction to ComponentsAbout the Component ManagerYFigure 6-1 The relationship between an application, the Component Manager, and componentsUsing the Component Manager!Opening Connections to Components+Opening a Connection to a Default ComponentFinding a Specific ComponentListing 6-1 Finding a component,Opening a Connection to a Specific Component(Listing 6-2 Opening a specific component%Getting Information About a Component1Listing 6-3 Getting information about a componentUsing a Component%Listing 6-4 Using a drawing component#Closing a Connection to a Component
Creating ComponentsThe Structure of a Component"Table 6-1 Request codes(continued))Listing 6-5 A drawing component for ovalsHandling Requests for ServiceResponding to the Open Request)Listing 6-6 Responding to an open requestResponding to the Close Request)Listing 6-7 Responding to a close request Responding to the Can Do Request,Listing 6-8 Responding to the can do request!Responding to the Version Request"Responding to the Register Request$Responding to the Unregister Request Responding to the Target Request)Responding to Component-Specific Requests+Listing 6-9 Responding to the setup request+Listing 6-10 Responding to the draw request,Listing 6-11 Responding to the erase request,Listing 6-12 Responding to the click request.Listing 6-13 Responding to the move to requestReporting an Error Code!Defining a Component’s InterfacesManaging ComponentsRegistering a Component$Listing 6-14 Registering a componentCreating a Component Resource/Listing 6-15 Rez input for a component resource%Establishing and Managing Connections4Figure 6-2 Supporting multiple component connections6Listing 6-16 Delegating a request to another component
Component Manager Reference Data Structures for Applications The Component Description RecordOFigure 6-3 Interaction between the componentFlags and componentFlagsMask fields-Component Identifiers and Component InstancesRoutines for ApplicationsFinding ComponentsFindNextComponentCountComponentsGetComponentListModSeedOpening and Closing ComponentsOpenDefaultComponent
OpenComponentCloseComponent$Getting Information About ComponentsGetComponentInfoGetComponentIconSuiteGetComponentVersionComponentFunctionImplementedRetrieving Component ErrorsGetComponentInstanceErrorData Structures for Components The Component Description RecordThe Component Parameters RecordRoutines for ComponentsRegistering ComponentsRegisterComponentRegisterComponentResourceRegisterComponentResourceFileUnregisterComponent!Dispatching to Component RoutinesCallComponentFunction CallComponentFunctionWithStorageManaging Component ConnectionsSetComponentInstanceStorageGetComponentInstanceStorageCountComponentInstancesSetComponentInstanceA5GetComponentInstanceA5Setting Component ErrorsSetComponentInstanceError*Working With Component Reference ConstantsSetComponentRefconGetComponentRefcon%Accessing a Component’s Resource FileOpenComponentResFileCloseComponentResFileCalling Other ComponentsDelegateComponentCallCapturing ComponentsCaptureComponentUncaptureComponentTargeting a Component InstanceComponentSetTarget!Changing the Default Search OrderSetDefaultComponentApplication-Defined RoutineMyComponent ResourcesThe Component Resource %Figure 6-4 Format of a component file>Figure 6-5 Structure of a compiled component ('thng') resource!
Summary of the Component ManagerTranslation Manager
About the Translation Manager!Opening Documents From the Finder9Figure 7-1 The Finder’s application-unavailable alert boxPFigure 7-2 The application-unavailable alert box for 'TEXT' and 'PICT' documents-Figure 7-3 The translation choices dialog box,Figure 7-4 A translation progress dialog box9Figure 7-5 The modified application-unavailable alert box'Opening Documents Within an Application/Figure 7-6 The enhanced file-opening dialog box$Translating Documents on the Desktop6Figure 7-7 Document Converter configuration dialog box!Sharing Data Between ApplicationsUsing the Translation Manager$Checking for the Translation ManagerGListing 7-1 Translation-specific selectors and response bit for Gestalt2Declaring the File Types Your Application Can Open,Listing 7-2 A sample resource of type 'open'Declaring Custom Kind Strings,Listing 7-3 A sample resource of type 'kind'Using File-Opening Dialog BoxesTranslating Files ExplicitlyWriting a Translation Extension Creating a Translation Extension8Listing 7-4 Sample resources for a translation extension5Dispatching to Translation Extension-Defined Routines4Listing 7-5 Handling Component Manager request codesCreating a Translation ListIFigure 7-8 A translation group with multiple source and destination types=Figure 7-9 A translation group with a single destination type&Figure 7-10 Point-to-point translation,Listing 7-6 Creating a file translation listIdentifying Files"Listing 7-7 Identifying file typesTranslating Files"Listing 7-8 Translating a document*Writing Application Translation ExtensionsTranslation Manager ReferenceTranslation Manager RoutinesGetting Translation Information"GetFileTypesThatAppCanNativelyOpenExtendFileTypeListCanDocBeOpenedTranslating Files
TranslateFile ResourcesThe Open Resource:Figure 7-11 Structure of a compiled open ('open') resourceThe Kind Resource:Figure 7-12 Structure of a compiled kind ('kind') resourceTranslation Extension Reference%Translation Extension Data StructuresFile Type SpecificationsFile Translation ListsScrap Type SpecificationsScrap Translation ListsTranslation Extension Routines*Managing Translation Progress Dialog BoxesSetTranslationAdvertisementUpdateTranslationProgress&Translation Extension-Defined Routines#File Translation Extension RoutinesDoGetFileTranslationListDoIdentifyFileDoTranslateFile$Scrap Translation Extension RoutinesDoGetScrapTranslationListDoIdentifyScrapDoTranslateScrap#
Summary of the Translation Manager"
Summary of Translation ExtensionsControl Panels
About Control Panels Control Panels7Figure 8-1 Two control panels, each with its own window-Figure 8-2 The General Controls control panelA Control Panel’s Resources-The Finder’s Interaction With Control Panels %Control Panels and System Extensions +About User Documentation for Control Panels;Figure 8-3 Control panel icons in the Control Panels folder/The Monitors Control Panel and Extensions to It%Figure 8-4 The Monitors control panel=Figure 8-5 An Options dialog box for the SurfBoard video cardCreating Control Panel Files/Defining the User Interface for a Control Panel,Figure 8-6 The River control panel interface3Figure 8-7 An icon for the River control panel file$Creating a Control Panel’s ResourcesResource IDs for Control Panels%Defining the Control Panel Rectangles#Figure 8-8 The Color control panel VFigure 8-9 Coordinates defining the rectangles of the River control panel display areaGListing 8-1 Rez input for a rectangle positions list ('nrct') resource Creating the Item List Resource:Listing 8-2 Rez input for an item list ('DITL' ) resource %Defining the Icon for a Control Panel Specifying the Machine Resource :Table 8-1 Possible settings for the machine resource masks8Listing 8-3 Rez input for a machine ('mach') resource<Creating the File Reference, Bundle, and Signature Resources=Listing 8-4 Rez input for a file reference ('FREF') resource .Listing 8-5 Rez input for a signature resource4Listing 8-6 Rez input for a bundle ('BNDL') resource2Providing Additional Resources for a Control Panel.Specifying the Font of Text in a Control Panel$Creating a Font Information Resource.Defining Text in a Control Panel as User Items?Listing 8-7 A control panel’s static text defined as user items!Writing a Control Panel Function %Listing 8-8 A control device function<Determining If a Control Panel Can Run on the Current System;Initializing the Control Panel Items and Allocating StoragePListing 8-9 Initializing a control panel: Allocating memory and setting controlsResponding to Activate Events0Figure 8-10 Example of an inactive control panel-Listing 8-10 Responding to an activate event Responding to Keyboard Events+Listing 8-11 Responding to a keyboard eventResponding to Mouse Events ?Listing 8-12 Responding to the user’s interaction with controlsResponding to Update Events)Listing 8-13 Responding to update events $Handling Text Defined as User Items /Listing 8-14 Drawing text defined as user itemsResponding to Null Events1Responding to the User Closing the Control Panel YListing 8-15 Terminating a control device function when the user closes the control panelHandling Edit Menu Commands-Listing 8-16 Responding to Edit menu commandsHandling Errors3Table 8-2 Error codes and their meaning(continued) 5
Creating an Extension for the Monitors Control Panel5Designing the User Interface for a Monitors Extension8Figure 8-11 An Options dialog box with standard controls9Figure 8-12 An Options dialog box with superuser controls1Figure 8-13 The SurfBoard monitors extension icon8Creating the Required Resources for a Monitors Extension1Creating a Card Resource for a Monitors Extension3Listing 8-17 Rez input for a card ('card') resource-Defining a Rectangle for a Monitors Extension9Figure 8-14 Display area defined by a rectangle resource 8Listing 8-18 Rez input for a rectangle ('RECT') resource7Creating an Item List Resource for a Monitors ExtensionDFigure 8-15 The SurfBoard Options dialog box with superuser controlsNListing 8-19 Rez input for the SurfBoard monitors extension item list resource"Creating the Monitor Code Resource5Supplying Optional Resources for a Monitors Extension-Specifying an Icon for the Options Dialog BoxIListing 8-20 Rez input for icon family resources for a monitors extensionSpecifying Version Information 6Listing 8-21 Rez input for a version ('vers') resource.Providing an Alternative Name for a Video Card=Listing 8-22 Rez input for the SurfBoard string list resourceSupplying Gamma Table Resources8Creating File Reference, Bundle, and Signature ResourcesMListing 8-23 Rez input for a file reference resource of a monitors extension DListing 8-24 Rez input for a bundle resource of a monitors extension%Including a System Extension Resource%Writing a Monitors Extension Function*Listing 8-25 A monitors extension functionHandling the Startup Message)Listing 8-26 Handling the startup messageXListing 8-27 Using a normal user rectangle or extending it to display superuser controlsPerforming Initialization /Listing 8-28 Initializing a monitors extension ;Listing 8-29 Drawing a line to separate superuser controls &Responding to a Click in the OK ButtonResponding to a Cancel Request.Handling Mouse Events for a Monitors Extension5Listing 8-30 Responding when a user clicks a control Handling Keyboard EventsGIncluding Another Control Panel Definition in a Monitors Extension File
Control Panels ReferenceApplication-Defined RoutinesControl Device Functions MyCdev-Table 8-3 Messages from the Finder(continued)Monitors Extension Functions MyMntrExt=Table 8-4 Messages from the Monitors control panel(continued) ResourcesThe Machine Resource>Figure 8-16 Structure of a compiled machine ('mach') resource :Table 8-5 Possible settings for the machine resource masks The Rectangle Positions ResourceIFigure 8-17 Structure of a compiled rectangle positions ('nrct') resourceThe Font Information ResourceFFigure 8-18 Structure of a compiled font information ('finf') resource)The Control Device Function Code ResourceThe Card Resource:Figure 8-19 Structure of a compiled card ('card') resourceThe Monitor Code ResourceThe Rectangle Resource?Figure 8-20 Structure of a compiled rectangle ('RECT') resource
Summary of Control PanelsDesktop ManagerAbout the Desktop DatabaseUsing the Desktop ManagerDesktop Manager ReferenceData StructureThe Desktop Parameter BlockRoutines3Locating, Opening, and Closing the Desktop DatabasePBDTGetPathPBDTOpenInform
PBDTCloseDownReading the Desktop DatabasePBDTGetIconPBDTGetIconInfoPBDTGetAPPLPBDTGetCommentAdding to the Desktop DatabasePBDTAddIconPBDTAddAPPLPBDTSetComment*Deleting Entries From the Desktop DatabasePBDTRemoveAPPLPBDTRemoveComment)Manipulating the Desktop Database Itself PBDTFlushPBDTGetInfo PBDTReset